package com.example.as_sum.activity;

import android.os.Handler;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.os.Bundle;
import android.widget.ListView;

import com.example.as_sum.R;
import com.example.as_sum.adapter.MyAdapter;

import java.util.ArrayList;

public class NewLayoutActivity extends BaseActivity {
    private CoordinatorLayout cLayout;
    private AppBarLayout aLayout;
    private CollapsingToolbarLayout cTLayout;
    private FloatingActionButton floatingButton;
    private ListView listview;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //initTitle("新布局");
    }

    @Override
    public int getContentId() {
        return R.layout.activity_new_layout;
    }

    @Override
    public void initView() {
//        //使用CollapsingToolbarLayout必须把title设置到CollapsingToolbarLayout上，设置到Toolbar上则不会显示
//        CollapsingToolbarLayout mCollapsingToolbarLayout =(CollapsingToolbarLayout) this.findViewById(R.id.collapsing_toolbar);
//        mCollapsingToolbarLayout.setTitle("CollapsingToolbar");
//        //通过CollapsingToolbarLayout修改字体颜色
//        mCollapsingToolbarLayout.setExpandedTitleColor(Color.WHITE);//设置还没收缩时状态下字体颜色
//        mCollapsingToolbarLayout.setCollapsedTitleTextColor(Color.GREEN);//设置收缩后Toolbar上字体的颜色

//        floatingButton=(FloatingActionButton)this.findViewById(R.id.floatingActionButton);
//        floatingButton.setBackgroundColor(Color.BLUE);
//        floatingButton.setRippleColor(Color.GREEN);
        listview=(ListView)this.findViewById(R.id.listview);
        MyAdapter adapter=new MyAdapter(this,initData());
        listview.setAdapter(adapter);
    }

    private ArrayList<String> initData() {
        ArrayList<String> list=new ArrayList<>();
        for (int i=0;i<30;i++){
            list.add("第"+i+"项");
        }
        return list;
    }

    @Override
    public void addListener() {

    }

    @Override
    public void loadData() {

    }

    @Override
    public Handler getHandler() {
        return null;
    }
}
